﻿@model WaiGaoQiaoWeb.Models.ArticleUnitVM
@{
    ViewBag.Title = "Add";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head
{

    <script type="text/javascript">
        $(document).ready(function () {
            $("form").makeValidationInline();
            //保存
            $("#btnSave").click(function (event) {

                if (!$("#fmEdit").valid()) {

                    return false;
                }
                $('#fmEdit').ajaxSubmit(function (callback) {
                    if (callback) {
                        showLoadingMsg("保存成功", { left: 200, top: 6 }, true, 3000); $(":input").each(function () {
                            if ($(this).attr("type") == "text" || $(this).attr("type") == "textarea") {
                                $(this).val("");
                            }
                        });
                        $("#Unit").focus();
                        CloseModelWindow(null, true,true);
                    }
                });
            }); // end of btnSave

            //关闭
            $("#btnCancel").click(function (e) {
                $(":input").each(function () {
                    if ($(this).attr("type") == "text" || $(this).attr("type") == "textarea") {
                        $(this).val("");
                    }
                });
                $("#Unit").focus();
                CloseModelWindow(null, true, true);
            });

        });
    </script>
}
@using (Html.BeginForm("Save", "ArticleUnit", FormMethod.Post, new { id = "fmEdit" }))
{
    @Html.ValidationSummary(true)
    <div class="mainpanel">
        @Html.HiddenFor(model => model.ID)
        <table style="width: 92%; ">
        <tr>
        <td colspan="4">&nbsp;</td>
        </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.AID)
                </td>
                <td>
                @Html.DropDownListFor(model => model.AID, ViewBag.AID as IEnumerable<SelectListItem>,new {@style="width:180px"})
                    @Html.ValidationMessageFor(model => model.AID)<span style="color: Red;">*</span>
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.Unit)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.Unit)
                    @Html.ValidationMessageFor(model => model.Unit)<span style="color: Red;">*</span>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.Remark)
                </td>
                <td>@Html.TextAreaFor(model => model.Remark)
                </td>
            </tr>
            </table>
       <div class="buttonpanel">
        <div style="float: right; margin-right: 10px;">
            <a id="btnSave" href="javascript:void(0);" class="button"><span>保存</span></a> <a
                id="btnCancel" href="javascript:void(0);" class="button"><span>关闭</span></a>
        </div>
    </div>
    </div>
}



